﻿using System.ComponentModel.DataAnnotations;
using K9Nano.Share;

namespace K9Nano.Web.Accounts.Dto
{
    public sealed class UserCreateInput
    {
        /// <summary>
        /// 姓名
        /// </summary>
        [Display(Name = "姓名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [RegularExpression(@"[\u4e00-\u9fa5a-zA-Z0-9]+",ErrorMessage = "{0}只能是中文、字母或者数字")]
        public string Name { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [Display(Name = "手机号")]
        [Required(ErrorMessage = "{0}不能为空")]
        [Phone(ErrorMessage = "{0}无效")]
        public string Phone { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Display(Name = "性别")]
        public EGenderType Gender { get; set; }

        /// <summary>
        /// 密码，至少6位
        /// </summary>
        [Display(Name = "密码")]
        [MinLength(6)]
        public string Password { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 头像地址
        /// </summary>
        [Display(Name = "头像地址")]
        public string Avatar { get; set; }

        /// <summary>
        /// 角色列表
        /// </summary>
        [Display(Name = "角色")]
        public string[] Roles { get; set; }

        /// <summary>
        /// 客户端ID
        /// </summary>
        public string ClientId { get; set; }
    }
}